package com.tianzeculture.stagebao.net;

import com.tianzeculture.stagebao.bean.BusinessHomepageBean;
import com.tianzeculture.stagebao.bean.ResultBean;
import com.tianzeculture.stagebao.bean.User;
import com.tianzeculture.stagebao.net.base.AppBaseRestUsageV2;
import com.tianzeculture.stagebao.network.net.httpclient.NewCustomResponseHandler;
import com.tianzeculture.stagebao.network.util.MD5Util;
import com.tianzeculture.stagebao.util.Util;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Administrator on 2018/7/18 0018.
 */

public class ArtistRestUsage extends AppBaseRestUsageV2 {

    private String ALENT_POOL = "/search/user.do";//人才库
    private String ADD_ALENT_POOL_TO_BASIC = "/alentPool/addAlentpooltobasic.do";//加入人才库基本信息
    private String SAVE_DATA = "/alent/saveData.do";//艺人加入人才库保存信息
    private String ADD_REPRESENTATIVE_WORK = "/works/addRepresentativeWork.do";//艺人修改个人代表作
    private String UPDATE_TALENT_POOL = "/alent/updateData.do";//艺人修改人才库信息
    private String PUSH_PHOTO_WORKS = "/works/addRepresentativeWork.do";//上传图片作品
    private String PUSH_VEDIO_WORKS = "/works/addVideoWork.do";//上传视频作品
    private String UPDATE_VEDIO_WORKS = "/works/ModVideoWork.do";//修改图片视频作品
    private String TO_WORKER = "/work/toMyWorker.do";//商家主页
    private String OFFER_DELETE = "/professio/delect.do";//删除报价
    private String OFFER_ADD = "/professio/add.do";//添加报价
    private String DELETE_PIC = "/works/deletePic.do";//删除单张
    private String ADD_PIC = "/works/addPic.do";//作品添加图片
    private String DELETE_ALL = "/works/deleteAll.do";//删除整条图片作品


    /**
     * 人才库
     */
    public void toAlentpool(int taskId, String adder, int userSex, String searcher, String price, String age, String stature, String weight, String professio, int page, int pageSize) {
        Map<String, String> paramMap = new HashMap<>();
        paramMap.put("adder", adder);
        paramMap.put("sex", String.valueOf(userSex));
        paramMap.put("nickname", searcher);
        paramMap.put("price", price);
        paramMap.put("age", age);
        paramMap.put("stature", stature);
        paramMap.put("weight", weight);
        paramMap.put("professio", professio);
        paramMap.put("page", String.valueOf(page));
        paramMap.put("pageSize", String.valueOf(pageSize));
        post(ALENT_POOL, Util.returnRealParam(paramMap), new NewCustomResponseHandler<ResultBean>(taskId) {
        }.setCallSuperRefreshUI(true));
    }

    /**
     * 加入人才库基本信息
     */
    public void addAlentpooltobasic(int taskId, String userArea, int userSex, String searcher, int page) {
        Map<String, String> paramMap = new HashMap<>();
        paramMap.put("userArea", userArea);
        paramMap.put("userSex", String.valueOf(userSex));
        paramMap.put("searcher", searcher);
        paramMap.put("page", String.valueOf(page));
        post(ADD_ALENT_POOL_TO_BASIC, Util.returnRealParam(paramMap), new NewCustomResponseHandler<User>(taskId) {
        }.setCallSuperRefreshUI(true));
    }

    /**
     * 删除报价
     */
    public void offerDelete(int taskId, String id) {
        Map<String, String> paramMap = new HashMap<>();
        paramMap.put("id", id);
        post(OFFER_DELETE, Util.returnRealParam(paramMap), new NewCustomResponseHandler<ResultBean>(taskId) {
        }.setCallSuperRefreshUI(true));
    }

    /**
     * 删除单张照片
     */
    public void deletePic(int taskId, String id, String path) {
        Map<String, String> paramMap = new HashMap<>();
        paramMap.put("id", id);
        paramMap.put("url", path);
        post(DELETE_PIC, Util.returnRealParam(paramMap), new NewCustomResponseHandler<ResultBean>(taskId) {
        }.setCallSuperRefreshUI(true));
    }

    /**
     * 删除整条图片作品
     */
    public void deleteAll(int taskId, String id) {
        Map<String, String> paramMap = new HashMap<>();
        paramMap.put("id", id);
        post(DELETE_ALL, Util.returnRealParam(paramMap), new NewCustomResponseHandler<ResultBean>(taskId) {
        }.setCallSuperRefreshUI(true));
    }

    /**
     * 添加修改作品图片
     */
    public void addPic(int taskId, Map<String, String> paramMap) {
        post(ADD_PIC, Util.returnRealParam(paramMap), new NewCustomResponseHandler<ResultBean>(taskId) {
        }.setCallSuperRefreshUI(true));
    }

    /**
     * 添加报价
     */
    public void offerAdd(int taskId, Map<String, String> paramMap) {
        post(OFFER_ADD, Util.returnRealParam(paramMap), new NewCustomResponseHandler<ResultBean>(taskId) {
        }.setCallSuperRefreshUI(true));
    }

//    /**
//     * 修改艺人人才库信息
//     */
//    public void saveData(int taskId, User user) {
//        Map<String, String> paramMap = new HashMap<>();
//        paramMap.put("userHeight", user.getUserHeight());//身高
//        paramMap.put("userWeight", user.getUserWeight());//体重
//        paramMap.put("userBust", user.getUserBust());//胸围
//        paramMap.put("userWaist", user.getUserWaist());//腰围
//        paramMap.put("userHipline", user.getUserHipline());//臀围
//        paramMap.put("shoeSize", user.getShoeSize());//鞋码
////        paramMap.put("tag", "");//标签
////        paramMap.put("experience", ""); //工作经验
//        post(SAVE_DATA, Util.returnRealParam(paramMap), new NewCustomResponseHandler<User>(taskId) {
//        }.setCallSuperRefreshUI(true));
//    }


    /**
     * 更新个人代表作
     *
     * @param taskId
     * @param params
     */
    public void addRepresentativeWork(int taskId, Map<String, String> params) {
        post(ADD_REPRESENTATIVE_WORK, Util.returnRealParam(params), new
                NewCustomResponseHandler<Map<String, String>>(taskId) {
                });
    }

    /**
     * 添加到人才库
     *
     * @param taskId
     * @param params
     */
    public void addTalentPool(int taskId, Map<String, String> params) {
        post(SAVE_DATA, Util.returnRealParam(params), new
                NewCustomResponseHandler<Map<String, String>>(taskId) {
                });
    }

    /**
     * 更新艺人资料
     *
     * @param taskId
     * @param params
     */
    public void updapteTalentPool(int taskId, Map<String, String> params) {
        post(UPDATE_TALENT_POOL, Util.returnRealParam(params), new
                NewCustomResponseHandler<Map<String, String>>(taskId) {
                });
    }

    /**
     * 上传图片作品
     *
     * @param taskId
     * @param params
     */
    public void pushPhotoWorks(int taskId, Map<String, String> params) {
        post(PUSH_PHOTO_WORKS, Util.returnRealParam(params), new
                NewCustomResponseHandler<Map<String, String>>(taskId) {
                });
    }

    /**
     * 上传视频作品
     *
     * @param taskId
     * @param params
     */
    public void pushVedioWorks(int taskId, Map<String, String> params) {
        post(PUSH_VEDIO_WORKS, Util.returnRealParam(params), new
                NewCustomResponseHandler<Map<String, String>>(taskId) {
                });
    }

    /**
     * 修改视频图片作品
     *
     * @param taskId
     * @param params
     */
    public void updateVedioWorks(int taskId, Map<String, String> params) {
        post(UPDATE_VEDIO_WORKS, Util.returnRealParam(params), new
                NewCustomResponseHandler<Map<String, String>>(taskId) {
                });
    }

    /**
     * 商家主页
     *
     * @param taskId
     * @param params
     */
    public void toWorker(int taskId, Map<String, String> params) {
        post(TO_WORKER, Util.returnRealParam(params), new
                NewCustomResponseHandler<BusinessHomepageBean>(taskId) {
                });
    }

    /**
     * 发色
     */
    private String hairColor;

    /**
     * 眼色
     */
    private String eyeColor;

    /**
     * 行业Id
     */
    private String industryId;
}
